CharRange

class CharRange(start: Char, endInclusive: Char) : CharProgression, ClosedRange<Char>

A range of values of type Char.

Constructors

CharRange
Link copied to clipboard
fun CharRange(start: Char, endInclusive: Char)

Types

Companion
Link copied to clipboard
object Companion

Functions

contains
Link copied to clipboard
open operator override fun contains(value: Char): Boolean

Checks whether the specified value belongs to the range.

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean

Checks whether the range is empty.

iterator
Link copied to clipboard
open operator override fun iterator(): CharIterator

Returns an iterator over the elements of this object.

toString
Link copied to clipboard
open override fun toString(): String

Properties

endInclusive
Link copied to clipboard
open override val endInclusive: Char

The maximum value in the range (inclusive).

first
Link copied to clipboard
val first: Char

The first element in the progression.

last
Link copied to clipboard
val last: Char

The last element in the progression.

start
Link copied to clipboard
open override val start: Char

The minimum value in the range.

step
Link copied to clipboard
val step: Int

The step of the progression.

Extensions

contains
Link copied to clipboard
inline operator fun CharRange.contains(element: Char?): Boolean

Returns true if this range contains the specified element.

random
Link copied to clipboard
inline fun CharRange.random(): Char

Returns a random element from this range.

fun CharRange.random(random: Random): Char

Returns a random element from this range using the specified source of randomness.

randomOrNull
Link copied to clipboard
inline fun CharRange.randomOrNull(): Char?

Returns a random element from this range, or null if this range is empty.

fun CharRange.randomOrNull(random: Random): Char?

Returns a random element from this range using the specified source of randomness, or null if this range is empty.